package com.ita.os.merchant.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import org.junit.Test;

public class DBUtilTest {

	@Test
	public void test() {
		Connection conn = null;
        PreparedStatement st = null;
        ResultSet rs = null;
        try{
            //获取数据库连接
            conn = DBUtil.getConnection();
            String sql = "insert into test1(name) values(?)";
            st = conn.prepareStatement(sql);
            st.setString(1, "gacl");
            int count = st.executeUpdate();
            System.out.println(count);

        }catch (Exception e) {
            e.printStackTrace();
        }finally{
            //释放资源
        	DBUtil.close(conn, st, rs);
        }
    }
	}

